package dropOffDesk;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * This class handles user events from the drop-off desk GUI
 * 
 * @author Andrew Stokes
 * 
 */
public class DeskController {

	private DropOffDesk desk;

	public DeskController(DeskPanel deskPanel, DropOffDesk desk) {

		this.desk = desk;
		this.desk.setIsOpen(false);
		deskPanel.setVisible(true);
		deskPanel.addCloseDeskButtonListener(new CloseDeskButtonListener());


	}

	// Handle the button event on the GUI and close the drop-off desk
	public class CloseDeskButtonListener implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			desk.setIsOpen(false);

		}
	}

}
